/*----date process start--------*/
function changeDateFormat(dmy){
	//return (dmy.substr(6, 4) + dmy.substr(3, 2) + dmy.substr(0,2));
	//dateformat YYYYMMDD not need change
	return dmy;
}

function isCorrectDate(Number1){
	var Number2  = changeDateFormat(Number1);
	for(var i = 0;i < 8;i++){
		var oneChar = Number2.charAt(i)
		if(oneChar < "0" || oneChar > "9"){
			return false
		}
	}
	if (!isDate(Number2)){
		return false
	}else{
		return true
	}
}

function isRyear(inputInt){
	if (inputInt % 100 == 0 && inputInt % 400 == 0 || inputInt % 100 != 0 && inputInt % 4 == 0){
		return true
	}else{
		return false
	}
}

function isDate(Number1){
	var year = parseFloat(Number1.substring(0,4))
	var month = parseFloat(Number1.substring(4,6))
	var day = parseFloat(Number1.substring(6,8))
	if (month < 1 || month > 12 || day < 1 || day > 31 || year < 1000 || year > 2050){
		return false
	}
	else if ((month == 4 || month == 6 || month == 9 || month ==11) && (day > 30)){
		return false
	}
	else if (isRyear(year) && month == 2 && day > 29 || !isRyear(year) && month == 2 && day > 28){
		return false
	}else{
		return true
	}
}

function CheckDate(Number1,name,State) {
	var inputValue = jhform.elements[Number1].value
	var inputForm  = jhform.elements[Number1]
	if(State==1){
		if(isEmpty(inputValue)){
			alert(name + "不能为空!")
			inputForm.focus()
			return false
		}
	}
	var InputDate=changeDateFormat(inputValue);
	if(!isEmpty(InputDate)){	
		if(!isInteger(InputDate)){
			alert(name + "输入必须为整数!")
			inputForm.focus()
			return false
		}
	}else{
		return true
	}
	if (!isCorrectDate(inputValue))
	{
		alert(name + "日期格式不正确! \n 标准日期格式:YYYYMMDD")
		inputForm.focus()
		return false
	}
	else{
		return true
	}
}

function CompareDate1(beginDate,bdName,endDate,edName){
	var bdValue = jhform.elements[beginDate].value
	var edValue = jhform.elements[endDate].value
	if(!CheckDate(beginDate,bdName)){
		return false
	}
	else if (!CheckDate(endDate,edName))
	{
		return false
	}
	else if (changeDateFormat(bdValue) > changeDateFormat(edValue))
	{
		alert(bdName + "不能大于" + edName)
		jhform.elements[beginDate].focus()
		return false
	}
	else {
		return true
	}
}

function CompareDate2(beginDate,bdName,endDate,edName){
	var bdValue = jhform.elements[beginDate].value
	var edValue = jhform.elements[endDate].value
	if(!CheckDate(beginDate,bdName)){
		return false
	}
	else if (!CheckDate(endDate,edName))
	{
		return false
	}
	else if (changeDateFormat(bdValue) >= changeDateFormat(edValue))
	{
		alert(edName + "不能小于或等于" + bdName)
		jhform.elements[beginDate].focus()
		return false
	}
	else {
		return true
	}
}

function CompareDate(beginDate,bdName,endDate,edName,State){
	if (State != "1" && State != "2")
	{
		alert("最后一个参数只能为1或者2!")
		return false
	}
	if(State == "1" && !CompareDate1(beginDate,bdName,endDate,edName)){
		return false
	}
	else if (State == "2" && !CompareDate2(beginDate,bdName,endDate,edName))
	{
		return false
	}
	else {
		return true
	}
}

function CompareDateNu(beginDate,bdName,endDate,edName,State,Nu){
	if (Nu == "1")
	{
		if(!CompareDate(beginDate,bdName,endDate,edName,State)){
			return false
		}
		else {
			return true
		}
	}else{
		if (!isEmptyE(beginDate)||!isEmptyE(endDate))
		{
			if(!CompareDate(beginDate,bdName,endDate,edName,State)){
				return false
			}
			else {
				return true
			}
		}else{
			return true
		}
	}
}
/*
function FormatDate(inputStr){
	var StrYear = inputStr.substring(0,4);
	var StrMou  = inputStr.substring(4,6);
	var StrDate = inputStr.substring(6,8);
	var timeStr = "";
	
	if(inputStr.length == 14){
		var StrHour = inputStr.substring(8,10);
		var StrMinu = inputStr.substring(10,12);
		var StrSeco = inputStr.substring(12,14);
		timeStr = " " + StrHour + ":" + StrMinu + ":" + StrSeco;
	}
	
	var StrAll = StrDate+'/'+StrMou+'/'+StrYear+ timeStr;
	document.write(StrAll)
}
*/

function FormatDate(inputStr, dateSymbol, timeSymbol){
	var StrAll = getFormatDate(inputStr, dateSymbol, timeSymbol);
	document.write(StrAll)
}

function getFormatDate(inputStr, dateSymbol, timeSymbol){
	var StrYear = inputStr.substring(0,4);
	var StrMou  = inputStr.substring(4,6);
	var StrDate = inputStr.substring(6,8);
	var timeStr = "";
	
	if(inputStr.length == 14){
		var StrHour = inputStr.substring(8,10);
		var StrMinu = inputStr.substring(10,12);
		var StrSeco = inputStr.substring(12,14);
		if(timeSymbol == null || timeSymbol == ""){
			timeStr = " " + StrHour + ":" + StrMinu + ":" + StrSeco;
		}else{
			timeStr = " " + StrHour + timeSymbol + StrMinu + timeSymbol + StrSeco;
		}
			
		
	}
	var StrAll = "";
	if(dateSymbol == null || dateSymbol == ""){
		StrAll = StrYear+'/'+StrMou+'/'+StrDate+ timeStr;
	}else{
		StrAll = StrYear+dateSymbol+StrMou+dateSymbol+StrDate+ timeStr;
	}
	return StrAll;
}

/*---- date process end ----*/

function isEmpty(Number1){
	if(Number1.length == 0){
		return true
	}
	return false
}

function isEmptyE(Number1){
	var inputValue = jhform.elements[Number1].value
	if(isEmpty(inputValue)){
		return true
	}
	return false
}

function IsEmpty(Number1, name){
	var inputValue = jhform.elements[Number1].value
	var inputForm  = jhform.elements[Number1]
	if (isEmpty(inputValue)){
		alert(name + "不能为空!")
		inputForm.focus()
		return true
	}
	return false
}


function Pssword(Number1,name,Nu){
	var inputValue = jhform.elements[Number1].value
	var inputForm  = jhform.elements[Number1]
		if (isEmpty(inputValue)){
			alert(name + "不能为空!")
			inputForm.focus()
			return true
		}else if(inputValue.length<6){
			alert(name + "应该大于5小于13!")
			inputForm.focus()
			return true
		}else
		return false
}

function PsswordName(Number1, name,Nu){
	var inputValue = jhform[Number1].value
	var inputForm  = jhform[Number1]
	if (isEmpty(inputValue)){
		alert(name + "不能为空!")
		inputForm.focus()
		return true
	}else if(inputValue.length<6){
		alert(name + "应该大于5小于13!") 
		inputForm.focus()
		return true
	}else
		return false
}

function IsAllEmpty(NumberStr,Name,Num){
	var StrNum = NumberStr
	var i,j ;
	var Str = ""
	for (var m = 0 ; m < Num ; m++){
		i = StrNum.indexOf("|")
		Str = StrNum.substring(0,i)
		if (Str=="") break;
		if(jhform.elements[Str].value!=""){
		return true
		break
		}
		j = StrNum.length
		StrNum = StrNum.substring(i+1,j)
	}
	alert(Name+"至少有一个不能为空!")
	return false
}


function BoxCheck(BoxString,Name,Num){

	if (jhform[BoxString].length==null){
		if(document.jhform[BoxString].checked){
			return false
		}
	}else{
		var j = 0
		for(var n = 0 ; n < jhform[BoxString].length ; n++ ){
			if(jhform[BoxString][n].checked){
				j=j+1
				if(Num!=null){
					if(j>Num){
					alert(Name+'不能大于'+Num)
					return true
					}
				}
			}
		}
		for(var m = 0 ; m < jhform[BoxString].length ; m++ ){
			if(jhform[BoxString][m].checked){
				return false
			}
		}
	}
	alert(Name+"不能为空!")
	return true
}


function isInteger(inputVal){
	Number1 = inputVal.toString()
	if(isNaN(Number1)){
		return false
	}
	return true
}

function IsInteger(Number1,name,state){
    var inputValue = jhform.elements[Number1].value
    var inputForm  = jhform.elements[Number1]
	if (state==1)
	{
		if (IsEmpty(Number1,name)){
			return false
		}
	}
	if (!isEmpty(inputValue))
	{
		if (!isInteger(inputValue)){
			alert(name + "应该为整数!")
			inputForm.focus()
			return false
		}
		if(inputValue==0){
			alert(name + "不能为0!")
			inputForm.focus()
			return false
		}
	}
	return true
}

function isDouble(inputVal, isNotStrict){
     inputStr = inputVal.toString()
     oneDecimal = false
     for(var i = 0;i < inputStr.length;i++){
       var oneChar = inputStr.charAt(i)
       if(oneChar == "." && !oneDecimal){
         oneDecimal = true
         if(isNotStrict != true){
	         if(i == 0 || i == (inputStr.length - 1)){
	         	return false;
	         }
         }
         continue
       }
		if(i==0){
			var m = -(-1-i)
			var twoChar =inputStr.charAt(m)
		   if((oneChar == "0"&&twoChar=="0")||oneChar < "0"|| oneChar > "9"){
			 return false
		   }
		}else{
		   if(oneChar < "0" || oneChar > "9"){
			 return false
		   }
		}
		if(i==inputStr.length){
			if(oneChar==0) return false
		}
     }
     return true
}

function isOneZero(inputVal){
     inputStr = inputVal.toString()
     oneDecimal = false     
     var oneChar = inputStr.charAt(0) 		 
		 var twoChar = inputStr.charAt(1)		   
		 if(oneChar == "0"&&twoChar!="."){
			 return inputStr.substring(1,inputStr.length);
		 }
		
     return inputVal
}

function IsAmt (inputStr,name,Poin){
	var re = /,/g;
	var tag=Poin
	if(Poin==null||Poin=='X'){
		Poin =2
	}
    var inputValue = jhform.elements[inputStr].value.replace(re,"")
	var inputStr1 = inputValue.toString()
	var inputForm  = jhform.elements[inputStr]
	if(isEmpty(inputValue)){
		document.jhform.elements[inputStr+1].value = ''
		return false
	}
	if(tag!='X'){
		if(inputValue==0){
			alert(name + "不能为0!")
			inputForm.focus()
			return false
		}
	}
	if(!isDouble(inputValue)){
			alert(name+"输入必须为标准金额!")
			inputForm.focus()
			return false
	}
	var i = inputStr1.indexOf(".")
	if ( (i == -1 && inputStr1.length > 14 ) || i > 14 )
	{
		alert(name + "整数长度不能大于14位")
		inputForm.focus()
	    return false
	}else if ( i != -1 && (inputStr1.length - i - 1) > Poin )
	{
		alert(name + "小数点位数不能大于"+Poin)
		inputForm.focus()
		return false
	}

	var blea = false
	var StrPo = ""
	if ((inputValue.length - i - 1)!=0&&i!=-1)
	{
		StrPo = inputValue.substring(i,inputValue.length)
		if(Poin!=0){
			var q= StrPo.length - 1;
			for(; q<Poin; q++){
				StrPo = StrPo + "0"
			}
		}
		
		var regExpe = /^[\x2E]0+$/;
		var aryStr = StrPo.match(regExpe);
		if(aryStr != null && (aryStr[0].length - 1) > Poin){
			if(Poin == 0){
				StrPo = "";
			}else{
				StrPo = StrPo.substring(0, Poin + 1);
			}
		}
		
		blea = true
	}else{
		if(Poin != 0){
			StrPo = ".";
			for(var q=0; q < Poin; q++){
				StrPo = StrPo + "0";
			}
		}
	}

	var StrInt = inputValue
	if(blea){
		StrInt = inputValue.substring(0,i)
	}

	var h = StrInt.length
	var m = h%3
	var StrZh=""
	var po = true
	if (m!=0&&h>3)
	{
		StrZh=StrInt.substring(0,m)+","
		StrInt = StrInt.substring(m,h)
	}else if (h<4)
	{
		if(h == 0)
		{
		StrInt = h
		}
		StrZh=StrInt+StrPo
		po = false
	}
	var k = (h - m)/3
	if(po){
		for (var n = 1 ;n<k+1 ;n++ )
		{
			StrZh = StrZh+StrInt.substring(0,3)
			if (n!=k)
			{
				StrZh = StrZh + ","
			}else
			{
				StrZh = StrZh  + StrPo
			}
			StrInt = StrInt.substring(3,(h-m))
		}
	}
	
	document.jhform.elements[inputStr+1].value = inputValue
	document.jhform.elements[inputStr].value = StrZh
	return true
}

function FormatHWAmt(Amt, Currency){
	var poin = 2;
	try{
		poin = parent.document.curMap.get(Currency);
	}catch(e){
		poin = 2;
	}
	return FormatAmt(Amt, poin);
}

function FormatAmt(Amt, Poin){
	if(Poin == null){
		Poin = 2;
	}
	var inputStr = Amt
	
	var w = inputStr.indexOf("-")
	if(w==0){
		inputStr = inputStr.substring(1,inputStr.length)
	}
	
	//// add format check if not amount return directly
	var re = /,/g;
	
	var inputamt = inputStr.replace(re,"")
	var strAmt= inputamt.toString()
	
	if(!isDouble(strAmt,true)){
		document.write(Amt)
		return false
	}
	////
	
	var i = inputStr.indexOf(".")
	

	var blea = false
	var StrPo = ""
	if ((inputStr.length - i - 1)!=0&&i!=-1)
	{
		StrPo = inputStr.substring(i,inputStr.length)
		if(Poin!=0){
			var q= StrPo.length - 1;
			for(; q<Poin; q++){
				StrPo = StrPo + "0"
			}
		}
		
		var regExpe = /^[\x2E]0+$/;
		var aryStr = StrPo.match(regExpe);
		if(aryStr != null && (aryStr[0].length - 1) > Poin){
			if(Poin == 0){
				StrPo = "";
			}else{
				StrPo = StrPo.substring(0, Poin + 1);
			}
		}
		
		blea = true
	}else{
		if(Poin != 0){
			StrPo = ".";
			for(var q=0; q < Poin; q++){
				StrPo = StrPo + "0";
			}
		}
	}

	var StrInt = inputStr
	if(blea){
		StrInt = inputStr.substring(0,i)
	}

	var h = StrInt.length
	var m = h%3
	var StrZh=""
	var po = true
	if (m!=0&&h>3)
	{
		StrZh=StrInt.substring(0,m)+","
		StrInt = StrInt.substring(m,h)
	}else if (h<4)
	{
		if(h == 0)
		{
		StrInt = h
		}
		StrZh=StrInt+StrPo
		po = false
	}
	var k = (h - m)/3
	if(po){
		for (var n = 1 ;n<k+1 ;n++ )
		{
			StrZh = StrZh+StrInt.substring(0,3)
			if (n!=k)
			{
				StrZh = StrZh + ","
			}else
			{
				StrZh = StrZh  + StrPo
			}
			StrInt = StrInt.substring(3,(h-m))
		}
	}
	if(w==0){
		StrZh = "-" +StrZh
	}
	document.write(StrZh)

}

function IsHWAmtById(displayId,hiddenId,name,Currency){
	var poin = 2;
	try{
		poin = parent.document.curMap.get(Currency);
	}catch(e){
		poin = 2;
	}
	return IsAmtById(displayId,hiddenId,name,poin);
}

function IsAmtById(displayId,hiddenId,name,Poin){
	var re = /,/g;
	var tag=Poin
	if(Poin==null||Poin=='X'){
		Poin =2
	}
	var inputValue = document.getElementById(displayId).value.replace(re,"")
	var inputStr1 = inputValue.toString()
	var inputForm  = document.getElementById(displayId)
	if(isEmpty(inputValue)){
		document.getElementById(hiddenId).value = ''
		return false
	}
	if(tag!='X'){
		if(inputValue==0){
			alert(name + "不能为0!")
			inputForm.focus()
			return false
		}
	}
	if(!isDouble(inputValue)){
		alert(name+"输入必须为标准金额!")
		inputForm.focus()
		return false
	}
	inputValue=isOneZero(inputValue)
	var i = inputStr1.indexOf(".")
	if ( (i == -1 && inputStr1.length > 14 ) || i > 14 )
	{
		alert(name + "整数部分不能大于14位")
		inputForm.focus()
		return false
	}else if ( i != -1 && (inputStr1.length - i - 1) > Poin )
	{
		alert(name + "小数点位数不能大于"+Poin)
		inputForm.focus()
		return false
	}

	var StrPo = ""
	var blea = false
	
	if ((inputValue.length - i - 1)!=0&&i!=-1)
	{
		StrPo = inputValue.substring(i,inputValue.length)
		if(Poin!=0){
			var q= StrPo.length - 1;
			for(; q<Poin; q++){
				StrPo = StrPo + "0"
			}
		}
		blea = true
	}else{
		if(Poin != 0){
			StrPo = ".";
			for(var q=0; q < Poin; q++){
				StrPo = StrPo + "0";
			}
		}
	}
	var StrInt = inputValue
	if(blea){
		StrInt = inputValue.substring(0,i)
	}
	var h = StrInt.length
	var m = h%3
	var StrZh=""
	var po = true
	if (m!=0&&h>3)
	{
		StrZh=StrInt.substring(0,m)+","
		StrInt = StrInt.substring(m,h)
	}else if (h<4)
	{
		if(h == 0)
		{
			StrInt = h
		}
		StrZh=StrInt+StrPo
		po = false
	}
	var k = (h - m)/3
	if(po){
		for (var n = 1 ;n<k+1 ;n++ )
		{
			StrZh = StrZh+StrInt.substring(0,3)
			if (n!=k)
			{
				StrZh = StrZh + ","
			}else
			{
				StrZh = StrZh  + StrPo
			}
			StrInt = StrInt.substring(3,(h-m))
		}
	}

	document.getElementById(hiddenId).value = inputValue
	document.getElementById(displayId).value = StrZh
	return true
}
function IsEmptyById(elementId, name){
	var inputValue = document.getElementById(elementId).value
	var inputForm  = document.getElementById(elementId)
	if (isEmpty(inputValue)){
		alert(name + "不能为空!")
		inputForm.focus()
		return true
	}
	return false
}

/*
function SplitPage(APage,Cpage,inputStr,inputValue,AA){
	var iPages = 5;
	var iSubPage = (Cpage%iPages);
	var StartPage = Cpage - (iSubPage-1) 	
	var EndPage = -(iSubPage - iPages - Cpage)
	if(iSubPage==0){
		EndPage =Cpage
		StartPage=Cpage -4
	}
	if(EndPage-APage>0 ){
		EndPage = APage
	}
		document.write('总页数 :'+APage+' [')
	if(StartPage>1){
		var page = StartPage - 1
			document.write('<a href=javascript:TxtSubmit("PAGE|'+inputStr+'","'+page+'|'+inputValue+'",'+AA+')><< </a>&nbsp;');
	}	

	for(var i=StartPage;i<=EndPage;i++) { 
		if (i!=Cpage) {
			document.write('<a href=javascript:TxtSubmit("PAGE|'+inputStr+'","'+i+'|'+inputValue+'",'+AA+')>'+i+'</a>&nbsp;');
		}else {
			document.write(i + '&nbsp;');
		}

	}

	if(EndPage-APage<0){
		var page = -(-1-EndPage)
			document.write('<a href=javascript:TxtSubmit("PAGE|'+inputStr+'","'+page+'|'+inputValue+'",'+AA+')> >></a>&nbsp;');
	}	
		document.write(']')
}
*/

/*
 * 根据新一代接口，对原来分页显示进行修改
 * 当前页 改为PAGE_JUMP
 */
function SplitPage(APage,Cpage,inputStr,inputValue,AA){
	//document.write('第 1 页/共 7 页[<img height="5" width="3" align="middle" src="../../images6/icon_page_Lo.jpg" /> 1 <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a href="#">5</a> <a href="#"><img height="5" width="3" align="middle" src="../../images6/icon_page_Rn.jpg" /></a>]');
	//数据验证
	if(APage<1){
		APage=1;
	}
	if(Cpage<1){
		Cpage = 1;
	}
	//alert(Cpage+'  '+APage);
	if(parseInt(Cpage)>parseInt(APage)){
		Cpage=APage;
	}
	document.write('第 '+Cpage+' 页/共 '+APage+' 页');
	var nlimg = '<img height="5" width="3" align="middle" src="../../images6/icon_page_Lo.jpg" />';//不能向左翻页
	var ylimg = '<a href="#"><img height="5" width="3" align="middle" src="../../images6/icon_page_Ln.jpg" /></a>';//可以像左翻页
	var nrimg = '<img height="5" width="3" align="middle" src="../../images6/icon_page_Ro.jpg" />';//不能向右翻页
	var yrimg = '<a href="#"><img height="5" width="3" align="middle" src="../../images6/icon_page_Rn.jpg" /></a>';//可以像右翻页
	/*
	var nlimg = '<a><<</a>';//不能向左翻页
	var ylimg = '<a href="#"><<</a>';//可以像左翻页
	var nrimg = '<a>>></a>';//不能向右翻页
	var yrimg = '<a href="#">>></a>';//可以像右翻页
	*/
	var apage = parseInt(APage);
	var cpage = parseInt(Cpage);
	var ca = cpage%5;
	if(ca == 0){
		ca =5
	}
	var st = cpage/5*5;
	var lflag = parseInt((cpage-1)/5)>0;//向左是否可以翻页，为true可以翻页
	var rflag = parseInt((cpage-1)/5)!=parseInt((apage-1)/5);//向右是否可以翻页，为true可以翻页
	//alert(lflag+'   '+rflag);
	document.write('[ ');
	if(lflag){
		document.write(ylimg);
	}else{
		document.write(nlimg);
	}
	var stpage =parseInt((cpage-1)/5)*5;
	
	for(var i =1;i<=5 && ((stpage+i)<= apage);i++){
		
		if(i == ca){//当前页
			document.write(' '+(stpage+i));
		}else{
			document.write(' <a href="#">'+(stpage+i)+'</a>');
		}
	}
	document.write(' ');
	if(rflag){
		document.write(yrimg);
	}else{
		document.write(nrimg);
	}
	
	document.write(' ]');
	
}

function checkEmail(emaile,state) {
	var Email = jhform.elements[emaile].value
	if(!isEmpty(Email)){
		var re = /\w+@\w+\.\w+/;
				if (!re.test(Email)){
					alert("电子邮件格式不合法!");
					jhform.elements[emaile].focus()
						return false
					}else
						return true
				}
	else
		return true
}

function TxtSubmit(Names,Values,AA,State){
		var i ,j,h,k ;
		var StrName = Names
		var StrValue = Values
		var StrNa = ""
		var StrVa = ""
		var strHidden = ""
		i = StrName.indexOf("|")
		h = StrValue.indexOf("|")
		while(i!="-1"){
			StrNa = StrName.substring(0,i)
			StrVa = StrValue.substring(0,h)
			strHidden = strHidden + "<input type=hidden name = \"" + StrNa +"\" value = \"" + StrVa + "\">"
			j = StrName.length
			StrName = StrName.substring(i+1,j)
			k = StrValue.length
			StrValue = StrValue.substring(h+1,k)
			i = StrName.indexOf("|")
			h = StrValue.indexOf("|")
		}
		AA.innerHTML = strHidden;
		if(State==null||State==""){
			window.document.jhform.submit();
		}
	}



function SubmitRadio(Number1,name,AA){
	var inputValue
	var strHidden = ""
	for(var i = 0 ; i< jhform[Number1].length ;i++){
		if(jhform[Number1][i].checked){
			inputValue = jhform[Number1][i].value
			strHidden = "<input type=hidden name = TXCODE value = \"" + inputValue + "\">"
			AA.innerHTML = strHidden;
			//alert(strHidden)
			return true
		}
	}
	alert(name+" have not select");
	return false
}

function openWin(Names,Values,AA){
			document.jhform.target='new';
			TxtSubmit(Names,Values,AA)
			document.jhform.target='';
}

function openNewWindow(URL,Hei,Wid,Win){
	if(Win=="" || Win==null){
		Win="Popup"
	}
	windowprops	= "height=" + Hei + ",width="+ Wid + ",location=no,scrollbars=yes,status=no,menubars=no,toolbars=no";
	window.open(URL, Win, windowprops);
}

function Print(){
	window.print();
}

function Close(){
	window.close();
}

function Back(State) {
	 if(State==null){
	 State='-1'
	 }
     history.go(State);
}

function SelectAll(inputStr){
	var StrAll = inputStr
	var i ,j ,h;
	var Str = ""
	i = StrAll.indexOf("|")
	Str = StrAll.substring(0,i)
	while(i!="-1"){
		Str = StrAll.substring(0,i)
		h = document.jhform.elements[Str].options.length
		for(var m = 0 ; m<h;m++ ){
		document.jhform.elements[Str].options[m].selected = true
		}
		j = StrAll.length
		StrAll = StrAll.substring(i+1,j)
		i = StrAll.indexOf("|")
	}

}


 //=========================================================
 //
 //  在本机对浏览器页面表格中的数据行进行排序的javascript函数 end
 //=========================================================
function trClick(elementSrc){
	if(elementSrc.tagName.toUpperCase()=='TR'){
		var elementList = elementSrc.getElementsByTagName('INPUT');
		for(var i = 0;i < elementList.length; i ++){
			if(elementList[i].type.toLowerCase() == 'radio'){
				elementList[i].checked = true;
				return;
			}
			if(elementList[i].type.toLowerCase() == 'checkbox'){
				elementList[i].checked = !elementList[i].checked;
				return;
			}
		}
	}else if(elementSrc.tagName.toUpperCase()=='INPUT'&&elementSrc.type.toLowerCase() == 'checkbox'){
		elementSrc.checked = !elementSrc.checked;
	}
}


//**************************************************************

//	提交交易后，灰掉按钮

//	Creation date: (2006-08-30)	

//	@author: huangyp

//	@version: 1.0

//	@param：buttonId

//	@param说明：

//		输入参数：buttonId-按钮的id

//	@condition：无

//	@调用样例

//	使用说明：如<script language="JavaScript">disableButton(document.all.buttonId);</script>

//**************************************************************

function disableButton(buttonId){

buttonId.className="button_lessThan4_dis";

buttonId.disabled=true;

}


function printResult(obj)
{
   obj.document.execCommand('Print',false);
}


function Menu_Change(Nun,code,name,NunN)
{
	var num,n, i, m ,k;
	num= Nun;
	m = document.jhform.elements[num].selectedIndex-1;
	if(NunN ==""||NunN ==null){
		k = num + 1
	}else{
		k = NunN
	}
		n = document.jhform.elements[k].length
	for(i = n - 1; i >= 0; i--)
		document.jhform.elements[k].options[i] = null;
	if (m>=0) {
	for(i = 0; i < code[m].length; i++){
		NewOptionName = new Option(name[m][i], code[m][i]);
		document.jhform.elements[k].options[i] = NewOptionName;
	}
		document.jhform.elements[k].options[0].selected = true;
	}
}


function RadioDisabled(inputStr){
	for (var w = 0 ; w < jhform.length ; w++){
		document.jhform.elements[w].disabled=false;
	}
	var StrAll = inputStr
	var i ,j ;
	var Str = ""
	i = StrAll.indexOf("|")
	Str = StrAll.substring(0,i)
	while(i!="-1"){
		Str = StrAll.substring(0,i)
		document.jhform.elements[Str].disabled=true;
		j = StrAll.length
		StrAll = StrAll.substring(i+1,j)
		i = StrAll.indexOf("|")
	}
}

//*****************帮定
function BindBoxT(NameB,Names,BC){
 	var StrName1 = Names
 	var StrName = Names
	var i ,j ,h, k;
	var StrNa = ""
	var StrVa = ""
	var strHidden = ""
	i = StrName.indexOf("|")
	if (jhform[NameB].length==null){
			while(i!="-1"){
				StrNa = StrName.substring(0,i)
				StrNaV = StrNa + "_0"
				StrVa =	document.jhform[StrNaV].value;
				strHidden = strHidden + "<input type=hidden name = \"" + StrNa+"\" value = \"" + StrVa + "\">"
				j = StrName.length
				StrName = StrName.substring(i+1,j)
				i = StrName.indexOf("|")
			}
			StrName = Names

	}else
	{
		for(var m = 0 ; m < jhform[NameB].length ; m++ ){
				i = StrName.indexOf("|")
				if(jhform[NameB][m].checked){
						while(i!="-1"){
						StrNa = StrName.substring(0,i)
						StrNaV = StrNa + "_" + m
						StrVa =	document.jhform[StrNaV].value;
						strHidden = strHidden + "<input type=hidden name = \"" + StrNa+"\" value = \"" + StrVa + "\">"
						j = StrName.length
						StrName = StrName.substring(i+1,j)
						i = StrName.indexOf("|")
					}
			}
				StrName = Names
		}
	}
 	BC.innerHTML = strHidden;
}